﻿using System;
using System.Data;

using Wicresoft.Common;

namespace Wicresoft.JDPostBoard.Entity
{
    [Table("ViewGiftApply", null, "JDPB.ConnectionString")]
    public class ViewGiftApply : ViewInfo
    {
        #region SQL column name consts
        public const string SQLCOL_ID = "ID";
        public const string SQLCOL_APPLYID = "ApplyID";
        public const string SQLCOL_GIFTID = "GiftID";
        public const string SQLCOL_GIFTNAME = "GiftName";
        public const string SQLCOL_GIFTPRICE = "GiftPrice";
        public const string SQLCOL_GIFTUNIT = "GiftUnit";
        public const string SQLCOL_GIFTCOUNT = "GiftCount";
        public const string SQLCOL_GIFTTOTAL = "GiftTotal";
        public const string SQLCOL_REMARK = "Remark";
        public const string SQLCOL_APPLIERNAME = "ApplierName";
        public const string SQLCOL_APPLIERDSNAME = "ApplierDsName";
        public const string SQLCOL_APPLIERDEPARTMENT = "ApplierDepartment";
        public const string SQLCOL_APPLYTITLE = "ApplyTitle";
        public const string SQLCOL_STATUS = "Status";
        public const string SQLCOL_CONFIRMTIME = "ConfirmTime";
        public const string SQLCOL_APPLYTIME = "ApplyTime";
        public const string SQLCOL_APPLYCOST = "ApplyCost";
        public const string SQLCOL_DEALTIME = "DealTime";
        public const string SQLCOL_DEALERID = "DealerID";
        public const string SQLCOL_DEALERNAME = "DealerName";
        public const string SQLCOL_DEALERDSNAME = "DealerDsName";
        #endregion


        #region Contructors
        /// <summary>
        /// Construct empty entity
        /// </summary>
        public ViewGiftApply() { }

        #endregion

        public override void Init(DataRow row)
        {
            ID = (int)ObjectType.IntTypeHelper.Read(row[SQLCOL_ID]);
            ApplyID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_APPLYID]);
            GiftID = (Guid)ObjectType.GuidTypeHelper.Read(row[SQLCOL_GIFTID]);
            GiftName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_GIFTNAME]);
            GiftPrice = (double)ObjectType.DoubleTypeHelper.Read(row[SQLCOL_GIFTPRICE]);
            GiftUnit = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_GIFTUNIT]);
            GiftCount = (double)ObjectType.DoubleTypeHelper.Read(row[SQLCOL_GIFTCOUNT]);
            GiftTotal = (double)ObjectType.DoubleTypeHelper.Read(row[SQLCOL_GIFTTOTAL]);
            Remark = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_REMARK]);
            ApplierName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERNAME]);
            ApplierDsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERDSNAME]);
            ApplierDepartment = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLIERDEPARTMENT]);
            ApplyTitle = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_APPLYTITLE]);
            Status = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_STATUS]);
            ConfirmTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_CONFIRMTIME]);
            ApplyTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_APPLYTIME]);
            ApplyCost = (double)ObjectType.DoubleTypeHelper.Read(row[SQLCOL_APPLYCOST]);
            DealTime = (DateTime)ObjectType.DateTimeTypeHelper.Read(row[SQLCOL_DEALTIME]);
            DealerID = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERID]);
            DealerName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERNAME]);
            DealerDsName = (string)ObjectType.StringTypeHelper.Read(row[SQLCOL_DEALERDSNAME]);
        }

        #region Properties
        #region Property <int> ID
        [Property("ID", 4, SqlDbType.Int, false, false)]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _ID = int.MinValue;
        #endregion

        #region Property <Guid> ApplyID
        [Property("ApplyID", 16, SqlDbType.UniqueIdentifier, false, false)]
        public Guid ApplyID
        {
            get { return _ApplyID; }
            set { _ApplyID = value; }
        }
        private Guid _ApplyID = Guid.Empty;
        #endregion

        #region Property <Guid> GiftID
        [Property("GiftID", 16, SqlDbType.UniqueIdentifier, false, false)]
        public Guid GiftID
        {
            get { return _GiftID; }
            set { _GiftID = value; }
        }
        private Guid _GiftID = Guid.Empty;
        #endregion

        #region Property <string> GiftName
        [Property("GiftName", 100, SqlDbType.NVarChar, false, false)]
        public string GiftName
        {
            get { return _GiftName; }
            set { _GiftName = value; }
        }
        private string _GiftName = null;
        #endregion

        #region Property <double> GiftPrice
        [Property("GiftPrice", 8, SqlDbType.Float, false, false)]
        public double GiftPrice
        {
            get { return _GiftPrice; }
            set { _GiftPrice = value; }
        }
        private double _GiftPrice = double.NaN;
        #endregion

        #region Property <string> GiftUnit
        [Property("GiftUnit", 100, SqlDbType.NVarChar, false, false)]
        public string GiftUnit
        {
            get { return _GiftUnit; }
            set { _GiftUnit = value; }
        }
        private string _GiftUnit = null;
        #endregion

        #region Property <double> GiftCount
        [Property("GiftCount", 8, SqlDbType.Float, false, false)]
        public double GiftCount
        {
            get { return _GiftCount; }
            set { _GiftCount = value; }
        }
        private double _GiftCount = double.NaN;
        #endregion

        #region Property <double> GiftTotal
        [Property("GiftTotal", 8, SqlDbType.Float, false, false)]
        public double GiftTotal
        {
            get { return _GiftTotal; }
            set { _GiftTotal = value; }
        }
        private double _GiftTotal = double.NaN;
        #endregion

        #region Property <string> Remark
        [Property("Remark", 1000, SqlDbType.NVarChar, false, false)]
        public string Remark
        {
            get { return _Remark; }
            set { _Remark = value; }
        }
        private string _Remark = null;
        #endregion

        #region Property <string> ApplierName
        [Property("ApplierName", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierName
        {
            get { return _ApplierName; }
            set { _ApplierName = value; }
        }
        private string _ApplierName = null;
        #endregion

        #region Property <string> ApplierDsName
        [Property("ApplierDsName", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierDsName
        {
            get { return _ApplierDsName; }
            set { _ApplierDsName = value; }
        }
        private string _ApplierDsName = null;
        #endregion

        #region Property <string> ApplierDepartment
        [Property("ApplierDepartment", 100, SqlDbType.NVarChar, false, false)]
        public string ApplierDepartment
        {
            get { return _ApplierDepartment; }
            set { _ApplierDepartment = value; }
        }
        private string _ApplierDepartment = null;
        #endregion

        #region Property <string> ApplyTitle
        [Property("ApplyTitle", 100, SqlDbType.NVarChar, false, false)]
        public string ApplyTitle
        {
            get { return _ApplyTitle; }
            set { _ApplyTitle = value; }
        }
        private string _ApplyTitle = null;
        #endregion

        #region Property <string> Status
        [Property("Status", 100, SqlDbType.NVarChar, false, false)]
        public string Status
        {
            get { return _Status; }
            set { _Status = value; }
        }
        private string _Status = null;
        #endregion

        #region Property <DateTime> ConfirmTime
        [Property("ConfirmTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime ConfirmTime
        {
            get { return _ConfirmTime; }
            set { _ConfirmTime = value; }
        }
        private DateTime _ConfirmTime = DateTime.MinValue;
        #endregion

        #region Property <DateTime> ApplyTime
        [Property("ApplyTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime ApplyTime
        {
            get { return _ApplyTime; }
            set { _ApplyTime = value; }
        }
        private DateTime _ApplyTime = DateTime.MinValue;
        #endregion

        #region Property <double> ApplyCost
        [Property("ApplyCost", 8, SqlDbType.Float, false, false)]
        public double ApplyCost
        {
            get { return _ApplyCost; }
            set { _ApplyCost = value; }
        }
        private double _ApplyCost = double.NaN;
        #endregion

        #region Property <DateTime> DealTime
        [Property("DealTime", 16, SqlDbType.DateTime, false, false)]
        public DateTime DealTime
        {
            get { return _DealTime; }
            set { _DealTime = value; }
        }
        private DateTime _DealTime = DateTime.MinValue;
        #endregion

        #region Property <string> DealerID
        [Property("DealerID", 100, SqlDbType.NVarChar, false, false)]
        public string DealerID
        {
            get { return _DealerID; }
            set { _DealerID = value; }
        }
        private string _DealerID = null;
        #endregion

        #region Property <string> DealerName
        [Property("DealerName", 100, SqlDbType.NVarChar, false, false)]
        public string DealerName
        {
            get { return _DealerName; }
            set { _DealerName = value; }
        }
        private string _DealerName = null;
        #endregion

        #region Property <string> DealerDsName
        [Property("DealerDsName", 100, SqlDbType.NVarChar, false, false)]
        public string DealerDsName
        {
            get { return _DealerDsName; }
            set { _DealerDsName = value; }
        }
        private string _DealerDsName = null;
        #endregion

        #endregion
    }
}
